package exfist;

import java.awt.Point;
import java.awt.image.BufferedImage;
import java.util.Vector;

/**
 * node with multiple children/parents intended to contain all the other points
 * @author brianmaccarthy
 *
 */
public class Control_Node extends Node
{
	private Vector<Node> children;
	public Control_Node()
	{
		
	}
	/**
	 * Contructs a new control node
	 * @param name the name of the node
	 * @param s the sprite image
	 * @param p the position
	 */
    public  Control_Node(String name,BufferedImage s,Point p)  
    { 
    	node_name = name;
    	sprite = s;
    	pos=p;
    	has_child = false;
    	player_high_block=false;
    	player_low_block=false;
    	children = new Vector<Node>();
    	is_hitable=true;
    	doing_something=true;
    	addChild(this);
    } 
	/**
	 * adds a child to the control node
	 * @param n the node
	 */
	public void addChild(Node n)
	{
		children.addElement(n);
	}
	/**
	 * returns a node
	 * @param i the index of the vector containing the nodes
	 * @return the node
	 */
	public Node getChild(int i)
	{
		return children.elementAt(i);
	}
}
